package com.weiyuwqj.server.mapper;

import com.weiyuwqj.api.model.SysConfigTicketRule;
import com.weiyuwqj.api.model.vo.SysConfigTicketRuleVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;
@Repository
public interface SysConfigTicketRuleMapper extends Mapper<SysConfigTicketRule> {

    List<SysConfigTicketRule> listUsableByNid(String nid);

    //不分页查询红包规则
    List<SysConfigTicketRuleVo> getCouponList(Map<String, Object> param);

    //不分页查询加息劵规则
    List<SysConfigTicketRuleVo> getTicketList(Map<String, Object> param);

    Integer insertRule(SysConfigTicketRule rule);

    void updateStatus(@Param("ruleId")Integer ruleId,@Param("oldStatus") Integer oldStatus,@Param("newStatus") Integer newStatus);

    void updateRule(SysConfigTicketRule rule);

    int updateRuleBeginTimerStatus(Map map);

    int updateRuleEndTimerStatus(Map map);

    SysConfigTicketRule getByInviteCode(String redeemCode);

    List<SysConfigTicketRule> getUsableTicket(Map map);
}